home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include "CInternetConfig.h"
-
- void main()
- {
- CInternetConfig theIC('IcTs');
- ICError err;
- Str255 emailAddress;
-
- // tell whether or not the component is installed
- if (theIC.ICComponentInstalled())
- {
- printf("The component is installed\n");
- }
- else
- {
- printf("The component is not installed\n");
- }
-
- err = theIC.Start();
- if (err == noErr)
- {
- printf("Internet Config started\n");
- }
- else
- {
- printf("Internet Config could not be started because of error %ld\n", err);
- return;
- }
-
- // print the user's email address
- err = theIC.GetEmailAddress(emailAddress);
- if (err == noErr)
- {
- PtoCstr(emailAddress);
- printf("Email address is %s\n", emailAddress);
- }
- else
- {
- printf("Could not get email address because of error %ld\n", err);
- }
-
- // Do a URL
- err = theIC.DoURL("\phttp://rhino.harvard.edu/dan/home.html");
- if (err == noErr)
- {
- printf("DoURL successful\n");
- }
- else
- {
- printf("Could not do URL because of error %ld\n", err);
- }
-
- // find the http helper
- FSSpec httpSpec;
- OSType httpCreator;
- err = theIC.GetWebHelper(&httpSpec, &httpCreator);
- if (err == noErr)
- {
- PtoCstr(httpSpec.name);
- printf("Web helper found (%s)\n", httpSpec.name);
- CtoPstr((char *)httpSpec.name);
- }
- else
- {
- printf("Could not locate web helper because of error %ld\n", err);
- }
-
- // find the screen font
- ICFontRecord screenFont;
- err = theIC.GetScreenFont(&screenFont);
- if (err == noErr)
- {
- PtoCstr(screenFont.font);
- printf("Screen font = %s\n", screenFont.font);
- CtoPstr((char *)screenFont.font);
- }
- else
- {
- printf("Could find screen font because of error %ld\n", err);
- }
- }
-